#!/bin/sh

# check nginx
wget --spider -nv http://127.0.0.1:801 >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
    wget --spider -nv http://127.0.0.1:901 >/dev/null 2>&1
	if [[ $? -eq 0 ]]; then
        return 0
    else
    	echo "[ERROR] [$(date +'%Y-%m-%d %H:%M:%S')] [PORT:901]"
        return 1
    fi
else
	echo "[ERROR] [$(date +'%Y-%m-%d %H:%M:%S')] [PORT:801]"
    return 1
fi